﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="lp_Comment.aspx.cs" Inherits="ZLDC.Estate.Quantify.workurl.lp_Comment" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

    <script src="../../js/jquery/jquery-1.3.2.js" type="text/javascript"></script>

    <link href="../../css/main1.css" rel="stylesheet" type="text/css" />
    <link href="../css/163css.css" rel="stylesheet" type="text/css" />

    <script src="../../js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>

    <script src="../../js/jquery.autocomplete.js" type="text/javascript"></script>

    <link href="../../js/jquery.autocomplete/jquery.autocomplete.css" rel="stylesheet"
        type="text/css" />
    <script type="text/javascript">
        var currentPage = 1; // 当前页
        var pageSize = 30; // 每页显示多少条
        var pageall = 0; // 总页数
        var total = 0; // 总记录数
        window.onload = function Commentlist(currentPage) {


            var txtstatrdate = document.getElementById('iStartDay').value;
            var txtenddate = document.getElementById('iEndDay').value;

            var dept = document.getElementById('tbUserName').value;
            document.getElementById('divComment').innerHTML = "<img src=\"../../images/loading.gif\"  />";
            $.ajax({
                type: "POST",
                url: "../AjaxServer.aspx",
                dataType: 'json',
                //data: "alt=commentlist&depttype=" + depttype + "",
                data: "alt=commentDeptList&dept="+dept+"&txtenddate=" + txtenddate + "&&txtstatrdate=" + txtstatrdate + "&pagesize=" + pageSize + "&page=" + currentPage + "",
                processData: false,
                timeout: '10000',
                success: function(msg) {
                    divComment(msg);

                },
                error: function() {
                    document.getElementById('divComment').innerHTML = "系统繁忙";

                }

            });

        }
            
            $(document).ready(function() {
                $("#tbUserName").autocomplete("../ajax/GetUser.aspx?type=2", { minChars: 2, extraParams: { uname: function() { return escape($('#tbUserName').val()); } }, scrollHeight: 350, width: 220, max: 100 });
                document.getElementById("tbUserName").focus();
            });
            
        function divComment(msg) {
            pageall = msg.page.pages;
            currentPage = msg.page.currentpage;
            total = msg.page.intResult;
           
            var arr = [];
            arr.push("<table  border='0' cellpadding='0' cellspacing='1' bgcolor='#a8c7ce'  class=\"table1\" valign='top' >");
            arr.push("<tr bgcolor=\"#353c44\" >");
            arr.push("<td   style='text-align: center;background-color: #d3eaef;width:80px;'  >");
            arr.push("<div >评论对象</div>");
            arr.push("</td>");
            arr.push("<td   style='text-align: center;background-color: #d3eaef;width:360px'>");
            arr.push("<div >评论</div>");
            arr.push("</td>");

            arr.push("<td   style='text-align: center;background-color: #d3eaef;width:120px'>");
            arr.push("<div >日期</div>");
            arr.push("</td>");
            arr.push("<td   style='text-align: center;background-color: #d3eaef;width:80px'>");
            arr.push("<div >创建者</div>");
            arr.push("</td>");
            arr.push("<td   style='text-align: center;background-color: #d3eaef;width:160px'>");
            arr.push("<div >创建部门</div>");
            arr.push("</td>");
            arr.push("</td>");
            arr.push("</tr>");


            for (var i = 0; i < msg.record.length; i++) {

                if (i % 2 == 0)
                    arr.push("<tr bgcolor='#FFFFFF'>");
                else
                    arr.push("<tr bgcolor='#EEEDED'>");
                arr.push("<td height='20' class='STYLE6'  style='text-align: center;'>");
                arr.push(msg.record[i].user_name);
                arr.push("</td>");
                arr.push("<td height='20' class='STYLE6'>");
                arr.push(msg.record[i].reply);
                arr.push("</td>");
                arr.push("<td height='20' class='STYLE6'>");
                arr.push(msg.record[i].txttime);
                arr.push("</td>");
                arr.push("<td height='20' class='STYLE6' style='color:red'>");
                arr.push(msg.record[i].createname);
                arr.push("</td>");
                arr.push("<td height='20' class='STYLE6' style='color:red'>");
                arr.push(msg.record[i].deptname);
                arr.push("</td>");
                arr.push("</tr>");
            }


            arr.push("</table>");
            arr.push("<div id=\"div7Page\" ></div>");

            document.getElementById('divComment').innerHTML = arr.join('');
            $("#div7Page").html(""); // 清空
            if (pageall > 1) {
                var pageHtml = LexunJS.showPage2(currentPage, pageall, "Commentlist"); // 分页
                $("#div7Page").html(pageHtml);
            }
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div id="divv2">
        <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#a8c7ce"
            style="height: 100%; margin:10px 0 0 10px;">
            <tr>
                <td style="width: 45%; text-align: left; background-color: #FFFFFF; cursor: pointer;"
                    valign="middle">
                    时间:<input id="iStartDay" name="iStartDay" class="txtbox" runat="server" onclick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-{%d}'})"
                        style="width: 100px;" />
                    ~
                    <input id="iEndDay" name="iEndDay" runat="server"  class="txtbox"  onclick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-{%d}'})"
                        style="width: 100px;" />
                </td>   <td style="text-align: left; background-color: #FFFFFF; cursor: pointer;" valign="middle">
                    部门： <input id="tbUserName" runat="server" maxlength="100" size="15" class="txtbox" style="width:150px"
                        /><input id="btnSearch" class="button_bak" type="button" value="查询" onclick="Commentlist(1)" />
                   
                </td>
                <td style="text-align: left; background-color: #FFFFFF; cursor: pointer;" valign="middle">
                  
                   
                </td>
            </tr>
            <tr>
                <td colspan="3" style='background-color: #FFFFFF; height: 100%'>
                    <div id="divComment">
                    </div>
                </td>
            </tr>
        </table>
    </div>
     <script src="../../js/LexunJS.js" type="text/javascript"></script>
    </form>
</body>
</html>
